<template>
  <ty-plm-button @click="handleClick">跳转到新增路由/my-page</ty-plm-button>

  <el-table size="small" :data="list" style="width: 100%">
    <el-table-column v-for="col in columns" :key="col.propertyName" :prop="col.propertyName" :label="col.displayName" :width="col.width" />
  </el-table>
</template>

<script setup>
import { request } from '@common/core';
import columns from './columns';

const list = ref([]);
onMounted(() => {
  request({
    method: 'post',
    url: '/rest/v1/search/classify/queryByConditionByPage',
    data: {
      columns,
      conditionGroups: [],
      conditionJoint: 'and',
      pageNum: 1,
      pageSize: 20,
      keyword: '',
      needCount: false,
      needSort: true,
      typeInthid: 'ty.inteplm.requirement.CTyCustomer',
      classificationOid: '394486806995337216'
    }
  }).then(({ data }) => {
    if (data.success) {
      list.value = data.data.list;
    }
  });
});

function handleClick() {
  window.tyRoot.router.push('/my-page');
}
</script>
